package com.djl.sqtg.service.impl;


import com.djl.sqtg.entity.Coupon;
import com.djl.sqtg.mapper.ColonelMapper;
import com.djl.sqtg.mapper.CouponMapper;
import com.djl.sqtg.service.ICouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CouponServiceImpl implements ICouponService {

    @Autowired
    private CouponMapper couponMapper;

    @Override
    public List<Coupon> getAllCoupon() {
        return couponMapper.getAllCoupon();
    }

    @Override
    public Integer getCouponNum() {
        return couponMapper.getCouponNum();
    }

    @Override
    public Integer updateCouponState(Integer cid,Integer state) {
        return couponMapper.updateCouponState(cid,state);
    }

    @Override
    public Integer addCoupon(Coupon coupon) {
        return couponMapper.addCoupon(coupon);
    }

    @Override
    public Integer editCoupon(Coupon coupon) {
        return couponMapper.editCoupon(coupon);
    }

    @Override
    public Integer delCoupon(Integer cid) {
        return couponMapper.delCoupon(cid);
    }

    @Override
    public List<Coupon> getAllCouponBySearch(String coupontype, String couponname) {
        return couponMapper.getAllCouponBySearch(coupontype,couponname);
    }

    @Override
    public Integer getCouponNumBySearch(String coupontype, String couponname) {
        return couponMapper.getCouponNumBySearch(coupontype,couponname);
    }
}
